System and method for providing a breathing gas

ABSTRACT

Systems and methods for providing a breathing gas are provided. In one embodiment, the method includes sensing a sensed parameter associated with delivery of the breathing gas, changing a control parameter associated with a flow/pressure control element in response to a difference between the sensed parameter and a first predetermined sensed parameter value during a first portion of a breathing cycle, determining a transition from the first portion to a second portion of the breathing cycle based at least in part on the changing control parameter, changing the control parameter to cause a first change in the sensed parameter during the second portion of the breathing cycle based at least in part on the determined transition, and changing the control parameter to cause a second change in the sensed parameter during a third portion of the breathing cycle based at least in part on the first predetermined sensed parameter value.

This is a continuation-in-part (CIP) of U.S. patent application Ser. No.10/601,720, filed Jun. 23, 2003, now U.S. Pat. No. 7,152,598 and alsoclaims priority to U.S. provisional patent application Ser. No.60/580,845, filed Jun. 18, 2004.

FIELD OF THE INVENTION

The invention relates generally to the delivery of a breathing gas to anairway of a patient, and more particularly, to the delivery of abreathing gas coordinated with the breathing cycle of the patient.

BACKGROUND

Obstructive sleep apnea is an airway breathing disorder caused byrelaxation of the muscles of the upper airway to the point where theupper airway collapses or becomes obstructed by these same muscles. Itis known that obstructive sleep apnea can be treated through theapplication of pressurized air to the nasal passages of a patient. Theapplication of pressurized air forms a pneumatic splint in the upperairway of the patient thereby preventing the collapse or obstructionthereof.

Within the treatment of obstructive sleep apnea, there are several knownCPAP regimens including, for example, mono-level CPAP and bi-level CPAP.Mono-level CPAP involves the constant application of a singletherapeutic or medically prescribed CPAP level. That is, through theentire breathing cycle, a single therapeutic positive air pressure isdelivered to the patient. While such a regimen is successful in treatingobstructive sleep apnea, some patients experience discomfort whenexhaling because of the level of positive air pressure being deliveredto their airways during exhalation.

In response to this discomfort, bi-level CPAP regimens were developed.Bi-level CPAP involves delivering a higher therapeutic CPAP duringinhalation and a lower therapeutic CPAP during exhalation. The highertherapeutic CPAP level is commonly known as inspiratory positive airwaypressure or “EPAP.” The lower therapeutic CPAP level is commonly knownas expiratory positive airway pressure or, “EPAP.” Since the EPAP islower than the IPAP, the patient needs to do less work during exhalationto exhale and thus experiences less discomfort, compared to themono-level CPAP regimen.

However, the development of bi-level CPAP significantly increased thesophistication of CPAP devices because the devices must accuratelydetermine when the patient is inhaling and exhaling and to properlycoordinate the IPAP and EPAP levels thereto. One approach is todetermine the instantaneous and average flow rates of air beingdelivered to the patient and then to compare the two to determinewhether a patient was inhaling or exhaling. If the instantaneous flowrate is greater than the average flow rate, the patient is deemed to beinhaling. If the instantaneous flow rate is less than the average flowrate, the patient is deemed to be exhaling.

While CPAP has been useful in the treatment of obstructive sleep apneaand other respiratory related illnesses such as, for example, chronicobstructive pulmonary disease and neuro-muscular disorders affecting themuscles and tissues of breathing, it is highly desirable to provideadditional ways of delivering a therapeutic breathing gas to a patient.

SUMMARY

In one aspect, a method of providing a breathing gas is provided. In oneembodiment, the method includes: a) sensing a sensed parameterassociated with delivery of the breathing gas, b) changing a controlparameter associated with a flow/pressure control element in response toa difference between the sensed parameter and a first predeterminedsensed parameter value during a first portion of a current breathingcycle, c) determining a transition from the first portion to a secondportion of the current breathing cycle based at least in part on thechanging control parameter, d) changing the control parameter to cause afirst change in the sensed parameter during the second portion of thecurrent breathing cycle based at least in part on the determinedtransition, and e) changing the control parameter to cause a secondchange in the sensed parameter during a third portion of the currentbreathing cycle based at least in part on the first predetermined sensedparameter value.

BRIEF DESCRIPTION OF THE DRAWINGS

In the accompanying drawings which are incorporated in and constitute apart of the specification, embodiments of the invention are illustrated,which, together with a general description of the invention given above,and the detailed description given below, serve to example theprinciples of this invention.

FIG. 1 is a functional block diagram illustrating one embodiment of asystem for delivering a breathing gas.

FIG. 2 is a flowchart illustrating one embodiment of a control processfor the system.

FIG. 3 is a graph illustrating a valve step position and mask pressureover time for one embodiment of the system.

FIG. 4 is a graph illustrating a valve step position and mask pressureover time for another embodiment of the system.

FIG. 5 is a graph illustrating a valve step position and mask pressureover time for yet another embodiment of the system.

FIG. 6 is another embodiment of a system for delivering a breathing gas.

FIGS. 7A-7C illustrate another embodiment of a control process for thesystem.

FIGS. 8A-8C illustrate a lung flow, valve step position, controlpressure and sensed pressure over time for the embodiment of the systemillustrated in FIG. 6.

FIG. 9 is yet another embodiment of a system for delivering a breathinggas.

DETAILED DESCRIPTION OF ILLUSTRATED EMBODIMENTS

Prior to discussing the various embodiments, a review of the definitionsof some exemplary terms used throughout the disclosure is appropriate.Both singular and plural forms of all terms fall within each meaning:

“Logic,” as used herein, includes but is not limited to hardware,firmware, software and/or combinations of each to perform a function(s)or an action(s), and/or to cause a function or action from anothercomponent. For example, based on a desired application or need, logicmay include a software controlled microprocessor, discrete logic such asan application specific integrated circuit (ASIC), or other programmedlogic device. Logic may also be fully embodied as software.

“Software,” as used herein, includes but is not limited to one or morecomputer readable and/or executable instructions that cause a computeror other electronic device to perform functions, actions, and/or behavein a desired manner. The instructions may be embodied in various formssuch as routines, algorithms, modules or programs including separateapplications or code from dynamically linked libraries. Software mayalso be implemented in various forms such as a stand-alone program, afunction call, a servlet, an applet, instructions stored in a memory,part of an operating system or other type of executable instructions. Itwill be appreciated by one of ordinary skill in the art that the form ofsoftware is dependent on, for example, requirements of a desiredapplication, the environment it runs on, and/or the desires of adesigner/programmer or the like.

“Breathing state,” as used herein, includes any state or combination ofstates where air is drawn into the lungs and/or expelled from the lungs.For example, a first breathing state may be associated with drawing airinto the lungs and a second breathing state may be associated withexpelling air from the lungs. Additionally, a breathing state can haveone or more sub-states. For example, the start of inhalation can be abreathing state and the end of inhalation can be another breathingstate, with the range therebetween defining one or more other breathingstates. Similarly, the start and end of exhalation, and the range therebetween, can also be defined by one or more breathing states.

The systems and methods described herein are particularly suited forassisting the respiration of spontaneously breathing patients, thoughthey may also be applied to other respiratory regimens including, forexample, acute and homecare ventilation. Referring now to FIG. 1, blockdiagram 100 illustrating one embodiment of a system is shown. The systemhas a controller 102 with control logic 104, a blower 106, a variableposition poppet valve 108 with a bi-directional stepper motor and apressure sensor 112. A flow path 110 provides a path for a flow ofbreathable gas from the valve 108 to a patient interface 114. Patentinterface 114 can be any nasal mask, face mask, cannula, or similardevice. Pressure sensor 112 senses a parameter of the breathing gas suchas the pressure in flow path 110, which is associated with andindicative of the pressure in the patient interface 114. The controller102 is preferably processor-based and can include various input/outputcircuitry including analog-to-digital (A/D) inputs and digital-to-analog(D/A) outputs. The controller 102 sends valve step position data 116 tothe valve 108 to control its position and the sensor 112 sends pressuredata 118 back to the controller 102 to be read.

The valve step position is preferably defined by the stepper motorspecification and can include step positions that are less than 1 stepor a whole step. Generally, the valve step position can range from anynegative number to any positive number. One preferable valve stepposition range includes 0 to 100, where step position 0 is associatedwith a fully closed valve position and step 100 is associated with afully open valve position. Therefore, for a given blower speed and valveconfiguration, each valve step position can be determined to beequivalent to an approximate pressure change (e.g., a valve stepposition equals a pressure change of 0.2 cm H₂O.)

While the embodiment of FIG. 1 has been described with reference to aflow/pressure control element in the form of a variable position valve108 and a sensor element in the form of a pressure sensor 112, theflow/pressure control and sensor elements can include other types ofdevices. For example, the flow/pressure control element can be avariable speed blower, a variable speed blower in combination with alinear valve or solenoid valve, a variable speed blower in combinationwith a stepper motor controlled variable position valve, a variablespeed blower in combination with a linear valve or solenoid valve and astepper motor controlled variable position valve, or any other suitablecombination of these components. The sensor element can include a flowsensor, temperature sensor, infra-red light emitter/sensor, motorcurrent sensor, or motor speed sensor alone or in combination with thepressure sensor. The data generated from these sensor(s) is fed back tothe controller 102 for processing.

Referring now to FIG. 2, the operation of the system will be describedwith reference to the flowchart illustrated therein. In the flowchartshereinafter, the rectangular elements denote processing blocks andrepresent software instructions or groups of instructions. Thequadrilateral elements denote data input/output processing blocks andrepresent software instructions or groups of instructions directed tothe input or reading of data or the output or sending of data. The flowdiagrams shown and described herein do not depict syntax of anyparticular programming language. Rather, the flow diagrams illustratethe functional information one skilled in the art may use to fabricatecircuits or to generate software to perform the processing of thesystem. It should be noted that many routine program elements, such asinitialization of loops and variables and the use of temporary variablesare not shown.

In block 200, the controller 102 opens the valve 108 and sets the blower106 to a speed that produces a predetermined pressure at its output.This predetermined pressure is generally set to a medically prescribedpositive pressure for a patient plus an additional pressure of, forexample, 5 cm H₂O, via a pressure-to-speed look-up table that is storedin the memory of the controller 102. While an additional pressure of 5cm H₂O has been described, other pressures including no additionalpressure can be chosen as well. The medically prescribed positivepressure is typically a pressure that is above the ambient pressure. Forexample, the prescribed pressure may range from 4 to 20 cm H₂O. Once theblower 106 is set to provide the set pressure, it is rarely, if ever,changed during active operation of the device. Instead, the controller102 uses the step position of the valve 108 to modulate the outputpressure through both a closed loop and an open loop control. The closedloop control is a function of sensed pressure and the open loop controlis a function of time. Together, these control loops direct theoperation of the system through the breathing cycle of a patient. Itshould also be noted that the closed loop and open loop control can alsobe based on other parameters such as, for example, instantaneous andaverage flow rates, temperature of the gases in the patient interface,and/or composition of the gases (e.g. CO₂) in the patient interface.

In block 202, pressure is read and stored for subsequent processing. Inblock 204, an average valve step position is determined and maintainedor updated. In step 206, the controller 102 determines if a pressuredrop has been sensed. This is preferably accomplished by comparing thepresently sensed pressure with the immediately preceding sensedpressure. If the presently sensed pressure is less, then a pressure drophas occurred and the flow proceeds to block 208. In block 208, thecontroller 102 increments the valve step position to compensate for thepressure drop. Incrementing the valve step position has the effect ofincreasing the flow and pressure of the breathing gas delivered from thevalve's output. The step position is changed iteratively until the erroror difference between the sensed pressures is minimized. During thisphase of operation, the controller 102 seeks to maintain a constantpressure in the flow path 112 until patient exhalation is sensed.

In block 210, the difference between the instantaneous and average valveposition is integrated over time and stored in memory. The summation ofsix such integrations is used to determine the start of an inhalationbreathing state by determining if the summation is greater than a startof inhalation threshold (blocks 212 and 214). If the summation isgreater than the threshold, the start of the inhalation breathing statehas occurred and a timer begins the measurement of the inhalationbreathing state in block 216. This measurement continues until a peakvalve step position has been found in block 218. The peak valve stepposition is determined by comparing the previous valve step position tothe present valve step position and saving in memory the step positionthat is greater as the peak valve step position. If the peak valve stepposition remains unchanged for some time period (e.g., 80 ms), then thecontroller 102 assumes that the peak valve step position has occurredfor this inhalation phase and stops the inhalation breathing state timemeasurement in block 220. The peak valve step position is a thresholdindicative of the imminent end of the inhalation breathing state.

In block 222, the controller 102 tests to determine if a pressureincrease has occurred by reading the pressure signal. If a pressureincrease has occurred after a peak valve step position has been found,then the inhalation breathing state is imminently ending. Block 224decrements the valve position to lower the flow and pressure provided soas to maintain a constant pressure in the air flow path. This is onceagain accomplished by an iterative process by which the error betweenthe presently sensed pressure and the previously sensed pressure isminimized. Block 226 tests to determine if the inhalation breathingstate has ended by comparing two variables, VAR₁ and VAR₂. Thesevariables are defined as follows:VAR₁=(Inst. Step Position)−(Avg. Step Position)VAR₂=[(Peak Step Position)−(Avg. Step Position)]*ThresholdThe variable “Threshold” is a percentage value such as, for example, 85%or 0.85, though other percentage values can also be chosen. IfVAR₁≦VAR₂, then the inhalation breathing state has ended and theexhalation breathing state has or is about to commence.

Block 228 decrements the valve step position according to an exhalationunloading function that lowers the pressure delivered over time so thatthe pressure initially delivered during the exhalation breathing stateis less than the pressure delivered during the inhalation breathingstate. The pressure is dropped until a predetermined minimum pressure isprovided, which can include ambient pressure. This lower pressure ismaintained in block 230 for an exhalation time period that is, forexample, 2.5 times the measured inhalation state time period. Multiplesother than 2.5 can also be selected after the expiration of this timeperiod, the pressure signal is read in block 232 and the valve stepposition is incremented according to a pressure loading function. Thepressure loading function reads the present pressure and returns overtime the output pressure to the medically prescribed positive pressure,where the system once again looks for a start of inhalation breathingstate.

In this manner, a positive pressure is provided during the inhalationphase of a breathing cycle to assist the patient in inhalation and alower pressure is provided during the exhalation phase of a breathingcycle to allow the patient to exhale against a lower pressure. Such asystem provides a level of comfort over other types of ContinuousPositive Airway Pressure delivery in that the patient is not required toexhale against the same pressure used during inhalation for anyappreciable period of time.

Referring now to FIG. 3, a chart illustrating a valve step positioncurve 300 and an output pressure curve 302 as a function of time isshown. The two curves have been overlaid to more clearly illustrate thesynchronization between pressure and valve step position. The operationdescription will now be reviewed with reference to the curves of FIG. 3.

Prior to state 0, the system is in the closed loop control and issensing the pressure at its output via its pressure sensor. Since thereis very little pressure change prior to state 0, the system ismaintaining a constant valve step position, which results in a constantoutput pressure (preferably, the medically prescribed positivepressure). This typically occurs at the end of patient exhalation wherethere is very little pressure change in the system caused by thepatient.

When the patient begins to inhale, a pressure drop is sensed by thepressure sensor 112. This pressure drop causes the system to furtheropen the valve 108 in a step-wise fashion to compensate for the drop inpressure caused by patient inhalation. During such inhalation, thesystem attempts to maintain an output pressure substantially equivalentto the medically prescribed positive pressure. Each step position of thevalve is equivalent to a known approximate pressure change (e.g., 0.2 cmH₂O). The difference between the sensed pressure and the set pressure(i.e., the medically prescribed positive pressure) generates an errorvalue, which the system attempts to minimize by appropriately adjustingthe valve step position, which appropriately adjusts the pressuredelivered.

State 0 occurs when the valve step position is increased and triggers afixed time period which leads to State 1. During this fixed time period,the difference between the instantaneous valve step position and theaverage valve step position is integrated over 6 time intervals. FIG. 3shows only 3 intervals for the sake of clarity. If the summation ofthese 6 integrations is greater than a threshold value, then a patientinhalation is assumed and an inhalation timer is started that measuresthe time of inhalation.

This inhalation time measurement is terminated when a peak valve stepposition has been reached in State 2. The peak valve step position isdetermined by comparing the previous valve step position to the presentvalve step position and saving in memory the step position that isgreater as the peak valve step position. If the peak valve step positionremains unchanged for some time period (e.g., 80 ms), then the systemassumes that the peak valve step position has occurred for thisinhalation phase.

After State 2, the system looks for an exhalation trigger. This isaccomplished by comparing two variables, both of which are based onvalve step position. The equations have defined above as VAR₁ and VAR₂.If VAR₁≦VAR₂ then the trigger exists and the system moves to State 3.

In State 3, the system closes the variable position valve 108 so as toprovide a lower pressure at its output. The valve 108 can be quickly andlinearly closed (e.g., with a fixed slope of 3 ms/step) by reducing thevalve step position to, for example, position 0 (i.e., closed) or someother position. During a significant portion of exhalation, the systemnow provides a lower pressure than that used during inhalation. Thismakes it easier for the patient to exhale.

From State 3 to State 4, the system is in open-loop control and does notvary the valve step position based on pressure or any other parameter.The valve remains in its step position during this fixed time period. Asdescribed above, the time period can be 2.5 times the previouslydetermined inhalation time (i.e., time from State 1 to State 2). This isthe pressure unloading portion of the system operation.

At State 4, the exhalation time period expires and the system graduallyapplies pressure to its output until the pressure once again reaches themedically prescribed positive pressure. The system is now re-loading thepressure at its output. This is accomplished by sensing the pressure atState 4, which is caused primarily by patient exhalation, and quicklychanging the valve step position to meet that pressure. Hence, thisphase of exhalation starts with a pressure that is dependent on thepatient exhalation pressure. From State 4 to State 5, the systemgradually changes the valve step position in a linear fashion (e.g.,with a fixed slope of 40 ms/step) thereby gradually opening the valveuntil the output pressure once again reaches the higher medicallyprescribed positive pressure. The system is now ready for the nextpatient inhalation where the process repeats.

FIG. 4 illustrates an embodiment of the invention directed to exhalationtrigger-based control. In this regard, the control is similar to thatexplained above, except that no inhalation trigger is provided. Inparticular, a breath cycle time is measured as a function of the peakvalve step position. The time between two peak valve step positions(State 2) is a measure of the breathing cycle time. The exhalationtrigger at State 3, unloading portion from States 3 to 4, and loadingportion from States 4 to 5 are the same as described above in connectionwith FIG. 3. The unloading portion (States 3 to 4) and loading portion(States 4 to 5) are defined to be percentages of the breath cycle timeof the previous breath cycle(s). These percentages can range broadly,but are typically chosen so that the unloading and loading portiontogether are from about 50% to about 85% of the breath cycle time. Theadvantage of this embodiment is that it requires less processing by thecontroller 102.

Illustrated in FIG. 5 is an embodiment of the present invention thatuses the instantaneous and average valve step position to detect thebreathing state of a patient and coordinates the pressure deliveredaccording to the detected states. In this embodiment, the system is inclosed-loop control mode where it is always sensing the pressure andadjusting its output based thereon. More specifically, as the patientbreathes, an average valve step position is established by virtue of thevalve step position increasing to raise the pressure delivered forinhalation and decreasing to reduce the pressure delivered forexhalation based on the pressure fed back to the controller 102. Bycomparing the instantaneous valve step position to the average valvestep position, the breathing state of the patient can be detected. Ifthe instantaneous valve step position is above the average valve stepposition, the patient is inhaling. If the instantaneous valve stepposition is below the average valve step position, the patient isexhaling. To reduce premature or erratic triggering, the average valvestep position can be offset above its true value for inhalationdetection and below its true value for exhalation detection.

In FIG. 5, reference 502 indicates the instantaneous valve step positioncrossing the average valve step position with a positive slope. Thisindicates the patient is inhaling because the valve is increasing itsstep position to compensate for the drop in pressure caused by thepatient inhalation. Reference 504 indicates the instantaneous valve stepposition crossing the average valve step position with a negative slope.This indicates the patient is exhaling because the valve is decreasingits step position to compensate for the increase in pressure caused bypatient exhalation. According to such detection, an IPAP level can beapplied during inhalation and an EPAP level can be applied duringexhalation. Reference 506 indicates the next inhalation detection.

Illustrated in FIG. 6 is another embodiment of the invention in the formof system 600. System 600 is similar to system 100 (FIG. 1) except thatthe variable position valve 108 is in a venting position with respect toflow path 110. Also, controller 102 includes control logic 602. In thisregard, breathing gas output by blower 106 travels within flow path 110to the patient interface 114. Variable position valve 108 is positionedso that it can divert breathing gas from flow path 110 and patientinterface 114. The step position of valve 108 is controlled by logic602. While the embodiment of FIG. 6 has been described with reference toa flow/pressure control element in the form of a variable position valve108 and a sensor element in the form of a pressure sensor 112, theflow/pressure control and sensor elements can include other types ofdevices. For example, the flow/pressure control element can be avariable speed blower, a variable speed blower in combination with alinear valve or solenoid valve, a variable speed blower in combinationwith a stepper motor controlled variable position valve, a variablespeed blower in combination with a linear valve or solenoid valve and astepper motor controlled variable position valve, or any other suitablecombination of these components. The sensor element can include a flowsensor, temperature sensor, infra-red light emitter/sensor, motorcurrent sensor, or motor speed sensor alone or in combination with thepressure sensor. The data generated from these sensor(s) is fed back tothe controller 102 for processing.

FIGS. 7A-C illustrate flowcharts directed to one embodiment of controllogic 602. In block 700, the controller 102 closes the valve 108 andsets the blower 106 to a speed that produces a predetermined pressure atits output. This predetermined pressure is generally set to a medicallyprescribed positive pressure for a patient, plus an additional pressurecomponent, via a pressure-to-speed look-up table that is stored in thememory of the controller 102. The additional pressure component can be apercentage of the set pressure or some other value. The additionalpressure component is provided so that the medically prescribed positivepressure can be delivered under most if not all patient demandscenarios. The medically prescribed positive pressure is typically apressure that is above the ambient pressure. For example, the prescribedpressure can range from 4 to 20 cm H₂O. Once the blower 106 is set toprovide the required pressure, it is rarely, if ever, changed duringactive operation of the device. Instead, the controller 102 uses thestep position of the valve 108 to modulate the output pressure.

In block 702, the pressure is read and stored. In block 704, the logicdetermines the median valve step position, breath rate (FIG. 7C), andupper and lower breathing rate thresholds. In one embodiment, the medianvalve step position and upper and lower breathing rate thresholds may bedetermined as follows:Median Valve Step=(Present*0.0003)+(Previous*0.9997)Breathing Rate Upper Threshold=Median+(Median*0.1)Breathing Rate Lower Threshold=Median−(Median*0.1)Wherein “Present” means present valve step position, “Previous” meansprevious median valve step position, and “Median” means median valvestep position. The logic may initially cycle through several breathingstates in determining the above values.

Once the upper and lower breathing rate thresholds are determined, thevalve step position is monitored for breathing rate determination.Referring to FIG. 7C, the slope of the valve step change is determinedin block 742. This may be accomplished by comparing the present and oneor more previous valve step positions over time. If the slope of thevalve step position is negative in block 744, the logic advances toblock 746. Otherwise, the logic loops back to blocks 742 or 704 tocontinue processing until the next valve step change. In block 746, thelogic tests to determine if the valve step position has fallen below theupper breathing rate (BR) threshold (see FIG. 8B). If so, the logicadvances to block 748 where it tests to determine if the valve stepposition has fallen below the lower breathing rate (BR) threshold (seeFIG. 8B). If so, the logic advances to block 750 where the end time isrecorded for the current breath and the start time is recorded for thenext breath. Based on the start and end time of each breath, a breathrate (e.g., breaths/minute) can be calculated and stored for subsequentuse.

Referring back to FIG. 7A, a pressure error is generated by comparingthe set pressure to the pressure read by the pressure sensor 112 inblock 706. In block 708, the pressure error is used to generate a valvestep error, which can be according to the following:V _(error)=(P _(error) *P)+(D _(error) *D)+(S _(error) *S)Where “V_(error)” is the valve step error, “P_(error)” is the pressureerror, “D_(error)” is the pressure error difference between the presentand the previous pressure error calculation, “S_(error)” is thesummation of the pressure errors, and “P,” “D,” and “S” are constants.The “V_(error)” equation generally defines a Proportional IntegralDerivative (hereinafter PID) servo controller. Generally, the constantsof “P,” “D,” and “S” are selected after empirical study of the behaviorof the system. Additionally, theoretical values can also be selected forthe constants. This PID servo control is active substantially throughoutthe logic's operation, though intermittent operation may also beacceptable during portions of the patient's breathing states. As will bedescribed, the logic utilizes various pressure settings for the PIDcontroller to generate the proper pressure outputs given the effects ofthe patient's breathing characteristics on the system's performance.

Block 710 tests to determine whether the valve step error is greaterthan or equal to zero. If so, the logic advances to block 712 where thevalve step position is incremented one or more steps so as to try toreduce the error. Otherwise, the logic advances to block 714 where thevalve step position is decremented one or more steps to try and reducethe error. It should be noted that the valve step position employed bythe logic may or may not equal one step of the stepper motor thatcontrols the movement of the valve. For example, one valve step may beequal to a half step movement of the valve's stepper motor.

After either steps 712 or 714, the logic advances to block 716 where thevalve step is monitored for a peak valve step position. In oneembodiment, the logic determines the inhalation threshold according tothe following:Inhalation Threshold=[(Peak−Median)*0.5]+MedianWherein “Peak” is the peak valve step position from one or more previousbreath cycles, “Median” is the median valve step position, and 0.5 is anexemplary scaling factor. Other scaling factor values may be used inother embodiments. After the present valve step position exceeds theinhalation threshold, the logic begins determining the peak valve stepposition. The peak valve step position is determined by comparing thepresent valve step position to the previous valve step position andchoosing the greater value.

In block 718, the logic determines the unload threshold according to thefollowing:Unload Threshold=[(Peak−Median)*T]+MedianWherein “Peak” is the peak valve step position from one or more previousbreath cycles, “Median” is the median valve step position, and “T” is apercent unloading trigger value that is determined from a look-up tablebased on the determined breaths per minute. One example of a breaths perminute based look-up table is shown below in Table 1:

TABLE 1 Breaths per minute T (% unloading) 0 −0.15 1 −0.15 2 −0.15 3−0.15 4 −0.15 5 −0.15 6 −0.15 7 −0.10 8 −0.10 9 −0.10 10 0.00 11 0.00 120.10 13 0.10 14 0.12 15 0.15 16 0.17 17 0.20 18 0.23 19 0.25 20 0.26 210.28 22 0.30 23 0.32 24 0.34 25 0.37 26 0.37 27 0.37 28 0.37 29 0.37 300.37In Table 1, each “Breaths per minute” value has a corresponding “T (%unloading)” value associated therewith in the form of values “X,” “Y,”and “Z”, which are typically equal to or less than 1. The “T (%unloading)” values can be the same or different for any given “Breathsper minute” value and determine how soon the unloading cycle starts withrespect to the median valve step position. For example, a “T (%unloading)” value closer to 1 would raise the unload threshold to behigher away from the median valve step position, thus causing thetriggering of a pressure reduction sooner with respect to valve stepposition. A “T (% unloading)” valve step closer to zero (0) would lowerthe unload threshold bringing it closer to the median valve stepposition, thus causing the triggering of a pressure reduction later withrespect to the valve step position. Generally, the larger the “Breathsper minute” valve, the larger the “T (% unloading)” value. It shouldalso be noted that one or more “Breaths per minute” values may have thesame or different “T (% unloading)” values associated therewith.

In block 720, the logic tests to determine whether the valve stepposition has fallen below the unload threshold. If not, the logic loopsback to block 702 to continue the active PID servo control of the valvestep position. If so, the logic advances to block 722. In block 722, thelogic determines the unload pressure and the pressure decrease controlwaveform and associated pressure settings. Also, a decrease timer isset. In one embodiment, the unload pressure is determined as follows:Unload Pressure=P _(set) −[P _(set)*((ΔV*V _(scale))/K)*S]where “P_(set)” is the medically described positive pressure, “ΔV” isthe change in valve step position defined by (Peak−Median), “V_(scale)”is a value selected from Table 2 (below) and is based on P_(set), “K” isa constant (e.g., in the range of 2000-4000, such as 3000) and “S” is aconstant in the range of 1-3 but can be smaller than 1 and larger than3. If the logic desires to simply maintain the pressure due to certainoperating conditions, the “S” constant may be set to 0 so that theunload pressure is equal to the prescribed pressure. The value of“V_(scale)” may be described pressure (P_(set)), for example, as shownin Table 2.

TABLE 2 P_(set) V_(scale) 0 0 1 0 2 0 3 0 4 0.28 5 0.28 6 0.25 7 0.25 80.25 9 0.23 10 0.23 11 0.22 12 0.22 13 0.18 14 0.15 15 0.15 16 0.14 170.14 18 0.12 19 0.12 20 0.12In Table 2, the P_(set) values range from 0 to 20 and represent a rangeof medically prescribed positive pressure values. Each P_(set) value hasa corresponding V_(scale) value (“A,” “B,” “C,” etc.) associated with itthat can be determined either by prior empirical or theoretical modelingof the system. For example, if system 600 is configured to work with awide range of patient interfaces 114, each type of patient interface 114may cause slight differences in the performance of system 600 at a givepressure of P_(set). Hence, one may choose to determine the V_(scale)values after understanding the impact of various patient interfaces onthe system performance. Generally, the “V_(scale)” values may range from0 to 0.28 as shown in Table 2, but other embodiments may go beyond thisrange. Moreover, certain safeguards may be employed to not allow theunload pressure to fall beyond certain levels. For example, if thepressure P_(set) is 4 cm H₂O, then the logic may not allow any pressureunloading due to the set pressure already being a very low medicallyprescribed positive pressure. However, in most circumstances, the UnloadPressure determination results in a value that is less than themedically prescribed positive pressure.

Further, in block 722, the logic determines, for example, 195 pressuresettings that define the control waveform for the pressure settingreduction down to the unload pressure setting. These pressure settingsare used by the active PID servo control. In one embodiment, the 195pressure settings are governed by a pressure decrease timer (e.g., 780ms). In one embodiment, the control waveform for the unload period canbe defined by a ramp down portion and a hold portion. The ramp downportion may include 10 pressure settings that sequentially reduce thepressure setting from the therapeutic pressure setting to the unloadpressure setting in, for example, 40 ms comprised of, for example, ten 4ms increments. The hold portion maintains the pressure setting at theunload pressure setting over, for example, 740 ms comprised of, forexample, 185 four ms periods. It should be noted that other values maybe chosen and the described values are merely meant to illustrate oneembodiment of the invention. It should also be noted that the sensedpressure can be used to re-determine or adjust the control waveformduring the ramping and/or hold portions of the unload period.

In block 724, the valve step position is adjusted in an attempt to havethe sensed pressure follow the pressure settings of the determinedcontrol waveform for the pressure setting reduction down to the unloadpressure setting. In other words, block 724 uses the same logic asblocks 706-714 because the active PID servo control is used to correctthe valve step position as the pressure settings of the control waveformare used for the desired pressure setting. For example, each of thepressure settings defines a “Set Pressure” that is compared to thesensed pressure to generate a pressure error that is used by the activePID servo control.

In block 726, the logic tests to determine whether the pressure decreasetimer (e.g., 780 ms) has expired. If so, the logic advances to block732. If not, the logic advances to block 728 where it determines whetherthe unload pressure setting in the control waveform has been reached. Ifthe pressure decrease timer has expired, the logic advances to block 732where it prepares for pressure reloading back up to the medicallyprescribed positive pressure. If the unload pressure setting has notbeen reached in block 728, the logic loops back to block 724 andcontinues the active PID servo control of the valve step positionaccording to the pressure settings of the control waveform. If theunload pressure setting has been reached in block 728, the logicadvances to block 730 where the unload pressure setting is maintainedthrough the active PID servo control of the valve step position untilthe pressure decrease timer expires.

After the pressure decrease timer has expired, the logic executes block732 where it determines the pressure increase control waveform andassociated pressure settings. Also, a pressure increase timer is set. Inone embodiment, the logic determines, for example, 100 pressure settingsthat define the control waveform for the pressure increase up to themedically prescribed positive pressure (therapeutic pressure). Thiswaveform is based on the pressure setting at the expiration of thedecrease timer and the medically prescribed positive pressure. In oneembodiment, the pressure increase timer may be set to 400 ms. In oneembodiment, the control waveform for the load period can be defined by aramp up portion. The ramp up portion may include 100 pressure settingsthat sequentially increase the pressure setting from the unload pressuresetting to the therapeutic pressure setting in, for example, 400 mscomprised of, for example, one hundred 4 ms increments. In anotherembodiment, control waveform for the load period can be defined by aramp up portion and a hold portion in similar fashion to the controlwaveform for the unload period described above. Once again, it should benoted that other values may be chosen and the described values aremerely meant to illustrate one embodiment of the invention. It shouldalso be noted that the sensed pressure can be used to re-determine oradjust the control waveform during the ramping and/or hold portions ofthe load period.

In block 734, the valve step position is adjusted in an attempt to havethe sensed pressure follow the pressure settings of the determinedcontrol waveform for the pressure setting increase up to the medicallyprescribed positive pressure setting. In other words, block 734 uses thesame logic as blocks 706-714 and 724 because the active PID servocontrol is used to correct the valve step position as the pressuresettings of the control waveform are used for the desired pressuresetting.

In block 736, the logic tests to determine whether the pressure increasetimer (e.g., 400 ms) has expired. If so, the logic advances to block 700wherein the pressure is set to the medically prescribed positivepressure. If not, the logic advances to block 738 where it determineswhether the medically prescribed positive airway pressure setting (e.g.,therapeutic pressure setting) in the control waveform has been reached.If the medically prescribed positive pressure setting has not beenreached in block 738, the logic loops back to block 734 and continuesthe active PID servo control of the valve step position according to thepressure settings of the control waveform. If the therapeutic pressurehas been reached in block 738, the logic advances to block 740 where themedically prescribed positive pressure setting is maintained through theactive PID servo control of the valve step position until the pressureincrease timer expires. Once the pressure increase timer expires, thelogic loops back to block 700 and the process repeats for the nextbreathing cycle.

Referring now to FIGS. 8A-8C, the lung flow, valve step position,control pressure and sensed pressure over time for the embodimentillustrated in FIG. 6 are shown. FIG. 8A illustrates the flow ofbreathing gas into and out of the lung over time. FIG. 8B illustratesthe valve step position over time, along with the median valve step,upper and lower breathing rate (BR) thresholds, inhalation threshold,and unload threshold. The use of these values and thresholds have beendescribed with reference to the logic of FIGS. 7A-7C. FIG. 8Cillustrates the control pressure waveform that determines the pressuresettings and the sensed pressure by the system. During inhalation, thePID servo controller tries to maintain the set pressure, which is themedically prescribed positive pressure for the patient. This causes thevalve step position to change due to patient demand, which increases toa peak valve step position and then decreases. During this phase, thepeak valve step position is monitored and the median valve step positionis calculated. When the valve step position falls below the unloadthreshold, the unload pressure is determined along with the pressuredecrease control waveform and associated pressure settings that are usedby the active PID servo control to reduce the pressure down to theunload pressure. A pressure decrease timer is also started. If thesensed pressure reaches the unload pressure prior to expiration of thedecrease timer due to the patient's breathing characteristics, theunload pressure is maintained by the active PID servo controller untilthe decrease timer expires. Once the decrease timer expires, independentof whether the unload pressure has been reached, a pressure increasecontrol waveform and associated pressure settings are determined basedon the sensed pressure at the expiration of the decrease timer and themedically prescribed positive pressure. The pressure increase controlwaveform is used by the active PID servo controller to raise thepressure back up to the set therapeutic pressure during the increasetime period. Because of the active PID servo controller and the effectof the patient's breathing characteristics, the pressure may rise to therequired therapeutic level prior to expiration of the increase timer.

Illustrated in FIG. 9 is yet another embodiment of the invention in theform of system 700. System 700 is similar to system 600 (FIG. 6). FIG. 9depicts an ambient input 702 and a filter 704 that provide ambient airto an input associated with the blower 106. The ambient input 702 andfilter 704 are implied in the previously described systems of FIGS. 1and 6 and corresponding blower operations. System 700 also includes anon-ambient input 704 which receives breathing gas diverted from theflow path 110 by the variable position valve 108. This arrangement isdifferent than in FIG. 6, where the variable position valve 108 divertsbreathing gas, but does not necessarily direct the diverted breathinggas back to the blower 106. Otherwise, the system 700 operates in thesame manner as system 600 which is described above in references toFIGS. 6, 7A-C, and 8A-C. Moreover, options, variations, and alternativesdescribed above in regard to system 600 are equally suitable for system700, except where they conflict with diverting the breathing gas to thenon-ambient input 704. In other embodiment, one or more additionalfilters between the filter 704 and the blower 106 may be provided.

While the present invention has been illustrated by the description ofembodiments thereof, and while the embodiments have been described inconsiderable detail, it is not the intention of this specification torestrict or in any way limit the scope of the appended claims to suchdetail. Additional advantages and modifications will readily appear tothose skilled in the art. For example, valve step position can bechanged according to non-linear function as an alternate, addition or incombination with linear functions. Alternate or additional parameters ofthe flow gas can be sensed including flow rates through the use of flowsensors to modulate valve step position. More specifically, thedirection of flow and/or the change in flow rates (e.g., instantaneousand average) can also be used. Therefore, the invention, in its broaderaspects, is not limited to the specific details, the representativeapparatus, and illustrative examples shown and described. Accordingly,departures may be made from such details without departing from thespirit or scope of the applicant's general inventive concept.

1. A method of providing a breathing gas comprising: a) sensing a sensedparameter associated with delivery of the breathing gas; b) changing acontrol parameter associated with a flow/pressure control element inresponse to a difference between the sensed parameter and a firstpredetermined sensed parameter value during an inhalation state of abreathing cycle; c) determining a transition from the inhalation stateto an exhalation state of the breathing cycle based at least in part onthe changing control parameter; d) changing the control parameter tocause a first change in the sensed parameter during an unload portion ofthe exhalation state based at least in part on the determinedtransition; and e) changing the control parameter to cause a secondchange in the sensed parameter during a load portion of the exhalationstate based at least in part on the first predetermined sensed parametervalue.
 2. The method of claim 1 wherein the sensed parameter isbreathing gas pressure, breathing gas flow, breathing gas temperature,or breathing gas composition.
 3. The method of claim 1 wherein theflow/pressure control element includes a variable position valve and thecontrol parameter includes a valve step position.
 4. The method of claim1 wherein the flow/pressure control element includes a variable speedblower and the control parameter includes a blower speed.
 5. The methodof claim 1 wherein the determining in c) comprises determining anaverage valve step position.
 6. The method of claim 1 wherein thedetermining in c) comprises identifying an instantaneous valve stepposition.
 7. The method of claim 1 wherein the determining in c)comprises determining a peak valve step position.
 8. The method of claim7 wherein determining the peak valve step position comprises identifyinga highest valve step position between a present valve step position andone or more previous valve step positions and if the highest valve stepposition does not change for a predetermined peak valve step time,identifying the highest valve step position as the peak valve stepposition.
 9. The method of claim 1 wherein the determining in c) isbased at least in part on a predetermined percentage threshold value.10. The method of claim 1 wherein the changing in d) comprisesdetermining an inhale time associated with the inhalation state.
 11. Themethod of claim 10 wherein the changing in d) comprises determining anexhale time associated with the unload portion of the exhalation stateand based at least in part on the determined inhale time.
 12. The methodof claim 11 wherein the duration of the unload portion of the exhalationstate is based at least in part on the exhale time.
 13. The method ofclaim 11 wherein the exhale time is based at least in part on apredetermined exhale time factor.
 14. The method of claim 1 wherein thechanging in d) is based at least in part on an unloading function. 15.The method of claim 1 wherein the changing in d) is based at least inpart on a second predetermined sensed parameter value.
 16. The method ofclaim 1 wherein the changing in d) comprises determining a peak valvestep position.
 17. The method of claim 1 wherein the changing in e) isbased at least in part on a loading function.
 18. A method of providinga breathing gas comprising: a) sensing a breathing gas pressureassociated with delivery of the breathing gas; b) detecting a start ofan inhalation state of a breathing cycle; c) changing a valve stepposition associated with a variable position valve in response to adifference between the sensed breathing gas pressure and a firstpredetermined breathing gas pressure value during the inhalation state;d) determining a transition from the inhalation state to an exhalationstate of the breathing cycle based at least in part on the changingvalve step position; e) changing the valve step position to cause afirst change in the breathing gas pressure during an unload portion ofthe exhalation state based at least in part on the determinedtransition; and f) changing the valve step position to cause a secondchange in the breathing gas pressure during a load portion of theexhalation state based at least in part on the first predeterminedbreathing gas pressure value.
 19. The method of claim 18 wherein thedetecting in b) comprises: g) determining an average valve stepposition; h) integrating a difference between an instantaneous valvestep position and the average valve step position over a predeterminedintegration time to produce a summation; and i) identifying the start ofthe inhalation state after the summation is greater than a predeterminedstart of inhalation threshold value.
 20. The method of claim 18 whereinthe determining in d) comprises: g) calculating a first transitionvariable based at least in part on an instantaneous valve step position;h) calculating a second transition variable based at least in part on apeak valve step position; and i) identifying the transition from theinhalation state to the exhalation state after the first transitionvariable is less than or equal to the second transition variable. 21.The method of claim 20 wherein the calculating in g) comprises: j)determining an average valve step position; k) identifying theinstantaneous valve step position; and l) calculating the firsttransition variable by subtracting the average valve step position fromthe instantaneous valve step position.
 22. The method of claim 20wherein the calculating in h) comprises: j) determining an average valvestep position; k) determining a peak valve step position for theinhalation state; and l) calculating the second transition variable bymultiplying a difference between the peak valve step position and theaverage valve step position by a predetermined percentage thresholdvalue.
 23. The method of claim 18 wherein the changing in e) comprises:g) determining an inhale time associated with the inhalation state; h)determining an exhale time associated with the unload portion of theexhalation state and based at least in part on the determined inhaletime; i) beginning the exhale time after the transition from theinhalation state to the exhalation state; j) decrementing the valve stepposition according to an unloading function until a second predeterminedbreathing gas pressure value is achieved; and k) changing the valve stepposition in response to a difference between the sensed breathing gaspressure and the second predetermined breathing gas pressure value afterthe second predetermined breathing gas pressure value is achieved anduntil the exhale time expires.
 24. The method of claim 23 wherein thedetermining in g) comprises: l) starting an inhalation timer after thestart of the inhalation state is detected; m) determining a peak valvestep position for the inhalation state; and n) stopping the inhalationtimer after the peak valve step position for the inhalation state isdetermined.
 25. The method of claim 23 wherein the exhale time in h) isa product of a predetermined exhale time factor and the determinedinhale time.
 26. The method of claim 18 wherein the changing in f)comprises: g) incrementing the valve step position according to aloading function until the first predetermined breathing gas pressurevalue is achieved; and h) changing the valve step position in responseto a difference between the sensed breathing gas pressure and the firstpredetermined breathing gas pressure value after the first predeterminedbreathing gas pressure value is achieved.
 27. A method of providing abreathing gas comprising: a) sensing a breathing gas pressure associatedwith delivery of the breathing gas; b) determining a breath cycle timeassociated with at least a portion of a current inhalation state of acurrent breathing cycle and a portion of a previous breathing cycle; c)changing a valve step position associated with a variable position valvein response to a difference between the sensed breathing gas pressureand a first predetermined breathing gas pressure value during thecurrent inhalation state; d) determining a transition from the currentinhalation state to a current exhalation state of the current breathingcycle based at least in part on the changing valve step position; e)changing the valve step position to cause a first change in thebreathing gas pressure during an unload portion of the currentexhalation state based at least in part on the determined transition;and f) changing the valve step position to cause a second change in thebreathing gas pressure during a load portion of the current exhalationstate based at least in part on the first predetermined breathing gaspressure value.
 28. The method of claim 27 wherein the determining in b)comprises: g) determining a peak valve step position for a previousinhalation state of the previous breathing cycle; h) starting a breathcycle timer after the peak valve step position for the previousbreathing cycle is determined; i) determining a peak valve step positionfor the current inhalation state; and j) stopping the breath cycle timerafter the peak valve step position for the current inhalation state isdetermined.
 29. The method of claim 27 wherein the determining in d)comprises: g) calculating a first transition variable based at least inpart on an instantaneous valve step position; h) calculating a secondtransition variable based at least in part on a peak valve stepposition; and i) identifying the transition from the current inhalationstate to the current exhalation state after the first transitionvariable is less than or equal to the second transition variable. 30.The method of claim 29 wherein the calculating in g) comprises: j)determining an average valve step position; k) identifying theinstantaneous valve step position; and l) calculating the firsttransition variable by subtracting the average valve step position fromthe instantaneous valve step position.
 31. The method of claim 29wherein the calculating in h) comprises: j) determining an average valvestep position; k) determining a peak valve step position for the currentinhalation state; and l) calculating the second transition variable bymultiplying a difference between the peak valve step position and theaverage valve step position by a predetermined percentage thresholdvalue.
 32. The method of claim 27 wherein the changing in e) comprises:g) determining an unloading time associated with the unload portion ofthe current exhalation state and based at least in part on thedetermined breath cycle time; h) beginning the unloading time after thetransition from the current inhalation state to the current exhalationstate; i) decrementing the valve step position according to an unloadingfunction until a second predetermined breathing gas pressure value isachieved; and j) changing the valve step position in response to adifference between the sensed breathing gas pressure and the secondpredetermined breathing gas pressure value after the secondpredetermined breathing gas pressure value is achieved and until theunloading time expires.
 33. The method of claim 32 wherein the unloadingtime in g) is a product of a predetermined unload time factor and thedetermined breath cycle time.
 34. The method of claim 27 wherein thechanging in f) comprises: g) determining a loading time associated withthe load portion of the current exhalation state and based at least inpart on the determined breath cycle time; h) beginning the loading timeafter the unload portion of the current exhalation state; i)incrementing the valve step position according to a loading functionuntil the first predetermined breathing gas pressure value is achieved;and j) changing the valve step position in response to a differencebetween the sensed breathing gas pressure and the first predeterminedbreathing gas pressure value after the first predetermined breathing gaspressure value is achieved and until the loading time expires.
 35. Themethod of claim 34 wherein the loading time in g) is a product of apredetermined load time factor and the determined breath cycle time. 36.A method of providing a breathing gas comprising: a) sensing a sensedparameter associated with delivery of the breathing gas; b) changing acontrol parameter associated with a flow/pressure control element inresponse to a difference between the sensed parameter and a firstpredetermined sensed parameter value during a first portion of a currentbreathing cycle; c) determining a transition from the first portion to asecond portion of the current breathing cycle based at least in part onthe changing control parameter; d) changing the control parameter tocause a first change in the sensed parameter during the second portionof the current breathing cycle based at least in part on the determinedtransition; and e) changing the control parameter to cause a secondchange in the sensed parameter during a third portion of the currentbreathing cycle based at least in part on the first predetermined sensedparameter value.
 37. The method of claim 36 wherein the sensed parameteris breathing gas pressure, breathing gas flow, breathing gastemperature, or breathing gas composition.
 38. The method of claim 36wherein the flow/pressure control element includes a variable positionvalve and the control parameter includes a valve step position.
 39. Themethod of claim 36 wherein the flow/pressure control element includes avariable speed blower and the control parameter includes a blower speed.40. The method of claim 36 wherein the changing in b) comprises: f)determining a valve step error based at least in part on the sensedparameter and the first predetermined sensed parameter value; and g)changing the control parameter to minimize the valve step error.
 41. Themethod of claim 40 wherein the sensed parameter is a breathing gaspressure and the determining in f) comprises: f) determining a currentpressure error by comparing the first predetermined sensed parametervalue to the sensed parameter; g) determining a pressure errordifference between the current pressure error and a previous pressureerror; h) determining a pressure error sum by adding the currentpressure error and the previous pressure error; and i) calculating thevalve step error by adding a first product of the current pressure errorand a first constant, a second product of the pressure error differenceand a second constant, and a third product of the pressure error sum anda third constant.
 42. The method of claim 36 wherein the flow/pressurecontrol element is a variable position valve, the control parameter is avalve step position, and the determining in c) comprises: f) determiningthe unload threshold value; and g) determining whether the changingvalve step position is less than the unload threshold value.
 43. Themethod of claim 42 wherein the determining in f) comprises: h)determining a breath rate; i) determining a median valve step position;j) determining a peak valve step position for one or more previousbreath cycles; k) identifying a predetermined percentage unloadingfactor associated with the determined breath rate; and l) calculatingthe unload threshold value based at least in part on the determinedmedian valve step position.
 44. The method of claim 43 wherein thedetermining in h) comprises: m) recording a start time for a currentbreath during a previous breathing cycle; n) recording an end time forthe current breath during a current breathing cycle; and o) calculatingthe breath rate based on the start and end times for the current breath.45. The method of claim 44 wherein the recording in m) comprises: p)determining an upper breath rate threshold value; q) determining a lowerbreath rate threshold value; r) identifying when a previous slope of aprevious valve step position change is negative during the previousbreathing cycle; s) monitoring the valve step position as it becomesless than the upper breath rate threshold value during the previousbreathing cycle; and t) recording the start time for the current breathafter the valve step position becomes less than the lower breath ratethreshold value.
 46. The method of claim 45 wherein the determining inp) comprises: u) calculating the upper breath rate threshold value byadding a predetermined percentage of the median valve step position tothe median valve step position.
 47. The method of claim 45 wherein thedetermining in q) comprises: u) calculating the lower breath ratethreshold value by subtracting a predetermined percentage of the medianvalve step position from the median valve step position.
 48. The methodof claim 44 wherein the recording in n) comprises: p) determining anupper breath rate threshold value; q) determining a lower breath ratethreshold value; r) identifying when a current slope of a current valvestep position change is negative during the current breathing cycle; s)monitoring the valve step position as it becomes less than the upperbreath rate threshold value during the current breathing cycle; and t)recording an end time for the current breath after the valve stepposition becomes less than the lower breath rate threshold value duringthe current breathing cycle.
 49. The method of claim 43 wherein thedetermining in i) comprises: m) identifying a present valve stepposition; and n) calculating the median valve step position by adding afirst predetermined percentage of the present valve step position to asecond predetermined percentage of a previous median valve stepposition, wherein a sum of the first and second predeterminedpercentages is one.
 50. The method of claim 43 wherein the determiningin j) comprises: m) determining an inhalation threshold; n) after thechanging valve step position exceeds the inhalation threshold,identifying a highest valve step position between a present valve stepposition and one or more previous valve step positions; and o) if thehighest valve step position does not change for a predetermined peakvalve step time, identifying the highest valve step position as the peakvalve step position.
 51. The method of claim 50 wherein the determiningin m) comprises: p) determining a difference between the peak valve stepposition and the median valve step position; q) determining a product ofthe determined difference and a predetermined inhalation scaling factor;and r) adding the determined product to the median valve step position.52. The method of claim 43 wherein the calculating in l) comprises: m)determining a difference between the peak valve step position and themedian valve step position; n) determining a product of the determineddifference and the predetermined percentage unloading factor; and o)adding the determined product to the median valve step position.
 53. Themethod of claim 36 wherein the changing in d) comprises: f) determininga second predetermined sensed parameter value; g) setting a decreasetimer to a predetermined unload time; h) determining a sequence ofpredetermined sensed parameter values for the second portion of thecurrent breathing cycle based at least in part on the first and secondpredetermined sensed parameter values; and i) changing the controlparameter based at least in part on the sequence of predetermined sensedparameter values until the decrease timer is expired.
 54. The method ofclaim 51 wherein the flow/pressure control element is a variableposition valve, the control parameter is a valve step position, thefirst predetermined sensed parameter value is a prescribed pressure, thesecond predetermined sensed parameter value is an unload pressure, andthe determining in f) comprises: j) determining a peak valve stepposition; k) determining a median valve step position; l) calculating apressure offset by subtracting the median valve step position from thepeak valve step position to obtain a first intermediate result,multiplying the first intermediate result by a first constant to obtaina second intermediate result, and multiplying the second intermediateresult by the prescribed pressure; and m) calculating the unloadpressure by subtracting the pressure offset from the prescribedpressure.
 55. The method of claim 36 wherein the changing in e)comprises: f) determining a second predetermined sensed parameter value;g) setting an increase timer to a predetermined load time; h)determining a sequence of predetermined sensed parameter values for thethird portion of the current breathing cycle based at least in part onthe first and second predetermined sensed parameter values; and i)changing the control parameter based at least in part on the sequence ofpredetermined sensed parameter values until the increase timer isexpired.
 56. A method of providing a breathing gas comprising: a)sensing a breathing gas pressure associated with delivery of thebreathing gas; b) changing a valve step position associated with avariable position valve in response to a difference between the sensedbreathing gas pressure and a first predetermined breathing gas pressurevalue during a first portion of a current breathing cycle; c)determining a transition from the first portion to a second portion ofthe current breathing cycle based at least in part on the changing valvestep position; d) changing the valve step position to cause a firstchange in the breathing gas pressure during the second portion of thecurrent breathing cycle based at least in part on the determinedtransition; and e) changing the valve step position to cause a secondchange in the breathing gas pressure during a third portion of thecurrent breathing cycle based at least in part on the firstpredetermined breathing gas pressure value.
 57. The method of claim 56wherein the changing in b) comprises: f) determining a valve step errorbased at least in part on the sensed parameter and the firstpredetermined sensed parameter value; and g) changing the controlparameter to minimize the valve step error.
 58. The method of claim 56wherein determining in c) comprises: f) determining the unload thresholdvalue; and g) determining whether the changing valve step position isless than the unload threshold value.
 59. The method of claim 56 whereinthe changing in d) comprises: f) determining a second predeterminedbreathing gas pressure value; g) setting a decrease timer to apredetermined unload time; h) determining a sequence of predeterminedbreathing gas pressure values for the second portion of the currentbreathing cycle based at least in part on the first and secondpredetermined breathing gas pressure values; and i) changing the valvestep position based at least in part on the sequence of predeterminedbreathing gas pressure values until the decrease timer is expired. 60.The method of claim 56 wherein the changing in e) comprises: f)determining a second predetermined breathing gas pressure value; g)setting an increase timer to a predetermined load time; h) determining asequence of predetermined breathing gas pressure values for the thirdportion of the current breathing cycle based at least in part on thefirst and second predetermined breathing gas pressure values; i)changing the valve step position based at least in part on the sequenceof predetermined breathing gas pressure values until the increase timeris expired.
 61. A method of providing a breathing gas to a patientcomprising: controlling a valve position to output a first target gaspressure level to the patient during at least a portion of the patient'sinhalation breathing state; monitoring an actual gas pressure leveloutput to the patient; determining a valve position setting based on themonitored gas pressure level; determining a valve position settingthreshold; determining at least a second target gas pressure level thatis less than the first target gas pressure level; if the valve positionsetting falls below the valve position setting threshold, controllingthe valve position to output the second target gas pressure level to thepatient for a predetermined time period during at least a first portionof the patient's exhalation breathing state; and controlling the valveposition to output the first target gas pressure level to the patientafter the predetermined time period has expired during at least a secondportion of the patient's exhalation breathing state.
 62. The method ofclaim 61 wherein determining a valve position threshold comprisesdetermining a difference between at least a peak valve position and amedian valve position and determining a patient breathing rate.
 63. Themethod of claim 61 wherein determining at least a second target gaspressure level that is less than the first target gas pressure levelcomprises lowering the at least first target pressure by a quantitybased at least in part on valve position.
 64. The method of claim 61wherein controlling the valve position to output the second target gaspressure level to the patient for a predetermined time period during atleast a first portion of the patient's exhalation breathing statecomprising outputting at least the second target gas pressure level atthe onset of exhalation for a predetermined time period.
 65. The methodof claim 61 wherein controlling the valve position to output the secondtarget gas pressure level to the patient for a predetermined time periodduring at least a first portion of the patient's exhalation breathingstate comprises determining a plurality of decrease target gas pressurelevels between the first target gas pressure level and the second targetgas pressure level.
 66. The method of claim 61 wherein controlling thevalve position to output the first target gas pressure level to thepatient after the predetermined time period has expired comprisesdetermining a plurality of increase target gas pressure levels betweenthe second target gas pressure level and the first target gas pressurelevel.
 67. The method of claim 61 wherein determining a valve positionsetting based on the monitored gas pressure level comprises comparingthe first target gas pressure level to the monitored gas pressure level.